🚀[Feature]: Use local PSScriptAnalyzer files#228
Merged
MariusStorhaug merged 5 commits intomainfrom Oct 11, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request updates GitHub Actions workflows to use a newer version of the PSScriptAnalyzer action and removes explicit Settings parameters to rely on local configuration files.
- Updated PSModule/Invoke-ScriptAnalyzer action from v3 to v4 in both workflows
- Removed explicit Settings parameters ("Module" and "SourceCode") to allow v4 to auto-detect local PSScriptAnalyzer configuration files
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/Test-Module.yml | Updated action version and removed Settings parameter for module linting |
| .github/workflows/Lint-SourceCode.yml | Updated action version and removed Settings parameter for source code linting |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The workflow now uses Invoke-ScriptAnalyzer@v4, enabling automatic discovery of local PSScriptAnalyzer configuration files. This allows projects to maintain custom linting rules in their repository without requiring centralized settings management. The upgrade also streamlines workflow configuration by removing deprecated parameters and improving checkout efficiency.
Updated to PSScriptAnalyzer v4
Upgraded the
PSModule/Invoke-ScriptAnalyzeraction from v3 to v4 in linting workflows (Lint-SourceCode.ymlandTest-Module.yml). This version automatically discovers and uses local.powershell-psscriptanalyzer.psd1configuration files from the.github/linters/directory, providing better support for repository-specific linting rules.Removed Deprecated Settings Parameter
The
Settingsparameter has been removed from bothLint-SourceCodeandLint-Moduleworkflow steps. PSScriptAnalyzer now automatically discovers local configuration files, eliminating the need to explicitly specify settings profiles.Workflow Configuration Improvements
Checkout repositorystep to theLint-Modulejob to ensure the codebase (including local configuration files) is available before lintingfetch-depth: 0from checkout steps to use shallow clones, reducing workflow execution timeNameparameter from test workflowCustom Linting Configuration Support
Added a
.powershell-psscriptanalyzer.psd1configuration file in the test repository (tests/srcWithManifestTestRepo/.github/linters/) demonstrating how projects can define custom code style rules, including formatting preferences, line length limits, and rule exclusions.